from app.model.base import *
from sqlalchemy import Index
from sqlalchemy.dialects.mysql import VARCHAR
from sqlalchemy import Column, String, text
class File(Base):
    __tablename__ = 'file'
    __table_args__ = {'comment': 'file'}
    id = Column(BIGINT(20), primary_key=True, comment='文件id')
    name = Column(VARCHAR(255), nullable=False,comment='文件名')
    info=Column(VARCHAR(255), nullable=False,server_default=text("''"),comment='概述',)
    extension = Column(String(255), nullable=False, comment='文件类型')
    url = Column(String(255), nullable=False, server_default=text("''"), comment='文件路径')
    user_id = Column(BIGINT(20), nullable=False, server_default=text("0"), comment='用户id')
    ai_id = Column(BIGINT(20), nullable=False, server_default=text("0"), comment='ai的id')
    size=Column(String(255), nullable=False, comment='文件大小')
indexes=[Index('vectorix', File.ai_id), Index('ai_mix_id', File.is_deleted, File.ai_id), Index('user_mix_id', File.is_deleted, File.user_id)]